﻿<Window x:Class="TFSTools.TestManagement.TestCaseReview.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="TFS Test Case Review" Height="600" Width="1000" MinWidth="250" MinHeight="250" Background="#FF384A6A"
        Activated="Window_Activated" WindowStartupLocation="CenterScreen" Icon="/TFSTools.TestManagement.TestCaseReview;component/Graphics/app.ico" Closing="Window_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Label Grid.Column="0" Content="Connection:" Margin="3" Foreground="White"></Label>
            <TextBox x:Name="tbxTFSServerInfo" Grid.Column="1" Margin="3" IsReadOnly="True" Text="Click 'Open Test Plan...'"></TextBox>
            <Button x:Name="btnConnect" Grid.Column="2" Content="Open Test Plan" Margin="3" Padding="10,1" Click="ConnectButton_Click"></Button>
            <Button Grid.Column="3" Margin="3" ToolTip="Save" Click="ConfigureButton_Click">
                <Image Source="/Graphics/configure.png" OpacityMask="White"></Image>
            </Button>
        </Grid>

        <Grid Grid.Row="1" Margin="5">

            <Grid Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="100" />
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition MinWidth="100" Width="1.5*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                
                <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" >
                    <Button x:Name="btnRefresh" Content="Refresh" Margin="3" Padding="10,1" Click="RefreshButton_Click" />
                    <Button x:Name="btnTestWorkIterm" Content="Test Work Item" Margin="3" Padding="10,1" Click="TestWorkItemButton_Click" Visibility="Collapsed"></Button>
                </StackPanel>

                <TreeView Grid.Row="1" 
                          x:Name="treeSuites" 
                          BorderThickness="0"
                          Padding="3"
                          SelectedItemChanged="SuitesTree_SelectedItemChanged">
                </TreeView>

                <GridSplitter Grid.Row="1" Grid.Column="1" 
                              ResizeBehavior="PreviousAndNext" 
                              Width="5"
                              BorderThickness="0"
                              HorizontalAlignment="Left" 
                              VerticalAlignment="Stretch" />

                <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Horizontal" >
                    <Button x:Name="btnOpenTestCase" Content="Open Test Case..." Margin="3" Padding="10,1" Click="OpenTestCaseButton_Click" IsEnabled="False" />
                </StackPanel>

                <DataGrid x:Name="dgWorkItems"
                          Grid.Row="1" 
                          Grid.Column="2" 
                          BorderThickness="0"
                          AutoGenerateColumns="False"
                          CanUserAddRows="False"
                          CanUserDeleteRows="False"
                          CanUserResizeRows="False"
                          RowHeaderWidth="0"
                          ScrollViewer.CanContentScroll="True"
                          ScrollViewer.VerticalScrollBarVisibility="Auto"
                          ScrollViewer.HorizontalScrollBarVisibility="Auto"
                          SelectionUnit="FullRow"
                          SelectionChanged="WorkItemsGrid_SelectionChanged"
                          MouseDoubleClick="WorkItemsGrid_MouseDoubleClick">
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="BorderThickness" Value="0"/>
                            <Setter Property="BorderBrush" Value="White" />
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="ID"
                                            Binding="{Binding Path=Id, Mode=OneWay}"
                                            CanUserSort="True"
                                            MinWidth="10"
                                            Width="60" />
                        <DataGridTextColumn Header="Title"
                                            Binding="{Binding Path=Title, Mode=OneWay}"
                                            CanUserSort="True"
                                            SortDirection="Ascending"
                                            MinWidth="50"
                                            Width="*" />
                        <DataGridTextColumn Header="State"
                                            Binding="{Binding Path=State, Mode=OneWay}"
                                            CanUserSort="True"
                                            MinWidth="50"
                                            Width="150" />
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </Grid>
    </Grid>
</Window>
